package com.leostadyn.stackfarm.timestatistics.presenter.admin;


import com.leostadyn.stackfarm.timestatistics.model.bean.StaffBean;
import com.leostadyn.stackfarm.timestatistics.model.mentity.admin.StaffManageModel;
import com.leostadyn.stackfarm.timestatistics.model.minterface.admin.IStaffManageModel;
import com.leostadyn.stackfarm.timestatistics.presenter.BasePresenter;
import com.leostadyn.stackfarm.timestatistics.view.vinterface.admin.IStaffManageView;

import java.util.ArrayList;

public class StaffManagePresenter extends BasePresenter<IStaffManageView> {

    public void refresh() {
        if (!isViewAttached()) {
            return;
        }
        mView = getView();
        mView.showWaiting();


        //presenter同时持有view model，数据操作调用model，UI操作调用view，view不直接访问model
        StaffManageModel.refresh(new IStaffManageModel() {
            @Override
            public void onSuccess(ArrayList<StaffBean> staffList) {
                mView.successMessage(staffList);
            }

            @Override
            public void onCompleted() {
                mView.dismissWaiting();

            }

            @Override
            public void onFailure() {

            }

            @Override
            public void onSuccess() {

            }

            @Override
            public void noInternet() {

            }
        });

    }

    public void toStaff() {

    }

}
